#ifndef SERVER_PROTECT
#define SERVER_PROTECT
#include "network.h"
#define REMOTE_FILE_STANDARD_PORT   9999
#define SRV_BUFFER_MAX_SIZE 		100
#define LENGTH_SIZE      			3
#define SHORT_CMD_LENGTH 			1
#define MIN_LONG_CMD_LENGTH 		2
#define NEW_LINE_LEN                2
#define LONG_CMD_LENGTH SHORT_CMD_LENGTH + LENGTH_SIZE + SRV_BUFFER_MAX_SIZE + NEW_LINE_LEN

typedef enum {
	CMD_READ   = 'r',
	CMD_APPEND = 'a',
	CMD_WRITE  = 'w',
	CMD_CLEAR  = 'c',
	CMD_RESET  = 'x', 
} cmd_t;



typedef struct {
	char cmd;
	char len[LENGTH_SIZE];
	
	// reserved for new line in READ command.
	// for other commands, leave blank:
	char newline[NEW_LINE_LEN]; 
} msg_t;

#define MSG_SIZE     sizeof(msg_t)

static unsigned int remoteFileProtection(rawPacket_t* packet);
#endif

